package ua.ck.example.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import ua.ck.example.dao.ProductDAO;
import ua.ck.example.domain.Product;

@Service("productService")
public class ProductServiceImpl implements ProductService {
	@Autowired
	private ProductDAO productDAO;

	@Override
	@Transactional
	public List<Product> listProducts() {
		return productDAO.listProducts();
	}

	@Override
	@Transactional
	public void addProduct(Product product) {
		productDAO.addProduct(product);

	}

	@Override
	@Transactional
	public List<Product> getProducts(Product product) {
		return productDAO.getProducts(product);
	}

	@Override
	@Transactional
	public void delProducts(Product product) {
		productDAO.delProducts(product);
	}

}
